import { useUserInfoStore } from '@/stores/user';
import http from '../utils/request'
const user:any = useUserInfoStore()

export function fetchChangeAddress(params) {
  return http.post('/app-api/cake/order/oprate_addr', {
    ...params,
    isDefault: params.isDefault?1:0,
    userId:  user.userId
  });
}

export function fetchAddressList() {
  return http.get('/app-api/cake/order/get_addr_list', {
    user_id: user.userId
  })
}

export function fetchRemoveAddress(addressId: string) {
  return http.get('/app-api/cake/order/del_addr', {
    id: addressId,
    user_id: user.userId
  })
}


